import { createStore } from 'vuex'

export default createStore({
  state: {
    count:0,
    isLogin:false
  },
  getters: {
  },
  mutations: {
    add(state,payload){
      if(!payload)
        state.count++;
      else
        state.count+=payload.n;
    }
  },
  actions: {
    addDelay({commit},payload){
      setTimeout(()=>{
        commit("add",payload);
      },2000)
    }
  },
  modules: {
  }
})
